<template>
	<view class="inspectInfo">
		<u-navbar title="巡检详情" back-icon-color="#fff"
			:background="{backgroundImage: 'linear-gradient(45deg, #68dae7, #21a4b3)'}" title-color="#FFFFFF">
		</u-navbar>
		<u-cell-group>
			<u-cell-item icon="" title="仪器名称" :value="inspectInfo.deviceName" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="巡检人" :value="inspectInfo.inspectedBy?inspectInfo.inspectedBy:''" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="巡检时间" :value="inspectInfo.inspectedTime?inspectInfo.inspectedTime:''" :arrow="false"></u-cell-item>
			</u-cell-group>
		</u-cell-group>
		<view class="inspectInfo-list">
			<view class="inspectInfo-list-item">巡检过程:{{inspectInfo.inspectedRecord?inspectInfo.inspectedRecord:""}}</view>
		</view>
		<view class="inspectInfo-list" style="padding-top: 0;">
			<view class="inspectInfo-list-title">巡检报告:</view>
			<image class="inspectInfoPng" mode="widthFix" @click="previewImage(inspectInfo.inspectedPic)" :src="inspectInfo.inspectedPic"></image>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				inspectInfo: {},
				url:[]
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getData()
		},
		methods:{
			getData(){
				let params = {
					id:this.id
				}
				this.$xt.api.inspectDetail(params).then(res=>{
					this.inspectInfo = res.data
					if(this.inspectInfo.inspectedPic) this.url.push(this.inspectInfo.inspectedPic)
				})
			},
			previewImage(url){
				uni.previewImage({
					current: url,
					urls:this.url
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.inspectInfo{
		&-list{
			background-color: #fff;
			padding: 13px 32rpx;
			color:#585858;
			&-item{
				// padding-left: 24rpx;
				margin-top: 12rpx;
			}
		}
		.inspectInfoPng{
			width: 30%;
			// height: 300rpx;
		}
	}
</style>